/*
 * You may freely copy, distribute and reuse the code in this example.  
 * NeXT disclaims any warranty of any kind, expressed or implied, as to 
 * its fitness for any particular use.
 */


#import "ScrollingSound.h"
#import <soundkit/soundkit.h>

@implementation ScrollingSound

- initFrame:(NXRect const *)theFrame
{
    NXRect tempRect = *theFrame;
    id theSoundView;
    int borderType = NX_NOBORDER;
    
    [ScrollView getContentSize:&tempRect.size forFrameSize:&theFrame->size
    		horizScroller:YES vertScroller:NO borderType:borderType];
    theSoundView = [[SoundView alloc] initFrame:&tempRect];
    [theSoundView setReductionFactor:32.0];
    [super initFrame:theFrame];
    [self setBorderType:borderType];
    [self setHorizScrollerRequired:YES];
    [self setDynamicScrolling:YES];
    [self setDocView:theSoundView];
    [self setBackgroundGray:NX_WHITE];
    [self setAutoresizeSubviews:YES];
    [self setAutosizing:NX_WIDTHSIZABLE|NX_HEIGHTSIZABLE];
    [[theSoundView superview] setAutoresizeSubviews:YES];
    [theSoundView setAutosizing:NX_HEIGHTSIZABLE];
    return self;
}

- play:sender {return [[self docView] play:sender];}
- stop:sender {return [[self docView] stop:sender];}
- record:sender {return [[self docView] record:sender];}


@end


